// **********************************************************************
//
// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************

// Ice version 3.3.0

package CommProxy;

public final class DataFrame implements java.lang.Cloneable
{
    public int ertuAddr;

    public int subErtuAddr;

    public short afn;

    public short commMode;

    public String tele;

    public short protocol;

    public short option;

    public byte[] data;

    public DataFrame()
    {
    }

    public DataFrame(int ertuAddr, int subErtuAddr, short afn, short commMode, String tele, short protocol, short option, byte[] data)
    {
        this.ertuAddr = ertuAddr;
        this.subErtuAddr = subErtuAddr;
        this.afn = afn;
        this.commMode = commMode;
        this.tele = tele;
        this.protocol = protocol;
        this.option = option;
        this.data = data;
    }

    public boolean
    equals(java.lang.Object rhs)
    {
        if(this == rhs)
        {
            return true;
        }
        DataFrame _r = null;
        try
        {
            _r = (DataFrame)rhs;
        }
        catch(ClassCastException ex)
        {
        }

        if(_r != null)
        {
            if(ertuAddr != _r.ertuAddr)
            {
                return false;
            }
            if(subErtuAddr != _r.subErtuAddr)
            {
                return false;
            }
            if(afn != _r.afn)
            {
                return false;
            }
            if(commMode != _r.commMode)
            {
                return false;
            }
            if(tele != _r.tele && tele != null && !tele.equals(_r.tele))
            {
                return false;
            }
            if(protocol != _r.protocol)
            {
                return false;
            }
            if(option != _r.option)
            {
                return false;
            }
            if(!java.util.Arrays.equals(data, _r.data))
            {
                return false;
            }

            return true;
        }

        return false;
    }

    public int
    hashCode()
    {
        int __h = 0;
        __h = 5 * __h + ertuAddr;
        __h = 5 * __h + subErtuAddr;
        __h = 5 * __h + (int)afn;
        __h = 5 * __h + (int)commMode;
        if(tele != null)
        {
            __h = 5 * __h + tele.hashCode();
        }
        __h = 5 * __h + (int)protocol;
        __h = 5 * __h + (int)option;
        if(data != null)
        {
            for(int __i0 = 0; __i0 < data.length; __i0++)
            {
                __h = 5 * __h + (int)data[__i0];
            }
        }
        return __h;
    }

    public java.lang.Object
    clone()
    {
        java.lang.Object o = null;
        try
        {
            o = super.clone();
        }
        catch(CloneNotSupportedException ex)
        {
            assert false; // impossible
        }
        return o;
    }

    public void
    __write(IceInternal.BasicStream __os)
    {
        __os.writeInt(ertuAddr);
        __os.writeInt(subErtuAddr);
        __os.writeShort(afn);
        __os.writeShort(commMode);
        __os.writeString(tele);
        __os.writeShort(protocol);
        __os.writeShort(option);
        DataPartHelper.write(__os, data);
    }

    public void
    __read(IceInternal.BasicStream __is)
    {
        ertuAddr = __is.readInt();
        subErtuAddr = __is.readInt();
        afn = __is.readShort();
        commMode = __is.readShort();
        tele = __is.readString();
        protocol = __is.readShort();
        option = __is.readShort();
        data = DataPartHelper.read(__is);
    }
}
